<template>
  <a-breadcrumb class="breadcrumb">
    <a-breadcrumb-item v-for="(item) in breadList" :key="item.name">
      <!-- <router-link
        v-if="item.name != name && index != 1"
        :to="{ path: item.path === '' ? '/' : item.path }"
      >{{ item.meta.title }}</router-link> -->
      <span>{{ item.meta.title }}</span>
    </a-breadcrumb-item>
  </a-breadcrumb>
</template>

<script>

export default {
  data () {
    return {
      name: '',
      breadList: []
    }
  },
  watch: {
    $route () {
      this.getBreadcrumb()
    }
  },
  created () {
    this.getBreadcrumb()
  },
  methods: {
    getBreadcrumb () {
      this.breadList = []
      this.$route.matched.forEach(item => {
        if (!item.meta.title || !item.path || item.path === '/') {
          return
        }
        if (item.path.includes('/manage') && !item.path.includes('/manage/')) {
          return
        }
        this.breadList.push(item)
      })
    }
  }
}
</script>

<style scoped>
</style>
